from enum import Enum

"""
    指令飞行相关的方法枚举
"""
class ControlFlyMethodEnum(Enum):
    FLIGHT_AUTHORITY_NOTIFY = "cloud_control_auth_notify"  # 请求授权结果通知
    FLY_TO_POINT_PROGRESS = "fly_to_point_progress"    # flyto 执行结果事件通知
    TAKEOFF_TO_POINT_PROGRESS = "takeoff_to_point_progress" # 一键起飞结果事件通知
    DRC_STATUS_NOTIFY = "drc_status_notify"   # DRC 链路状态通知
    JOYSTICK_INVALID_NOTIFY = "joystick_invalid_notify"     # DRC 飞行控制无效原因通知
    CAMERA_PHOTO_TAKE_PROGRESS = "camera_photo_take_progress"  # 上报拍照进度
    DRC_DELAY_INFO_PUSH = "delay_info_push"  # DRC-图传链路延时信息上报
    DRC_OBSTACLE_INFO_PUSH = "hsi_info_push"   # DRC-避障信息上报
    RETURN_HOME_INFO = "return_home_info" # 返航信息
    CLOUD_CONTROL_AUTH_REQUEST = "cloud_control_auth_request" # 请求授权云端控制
    CLOUD_CONTROL_RELEASE = "cloud_control_release"  # 释放云端控制
    DRC_MODE_ENTER = "drc_mode_enter"  # 进入指令飞行控制模式
    DRC_MODE_EXIT = "drc_mode_exit"  # 退出指令飞行控制模式
    TAKEOFF_TO_POINT = "takeoff_to_point"  # 一键起飞
    FLY_TO_POINT = "fly_to_point"  # flyto 飞向目标点
    FLY_TO_POINT_STOP = "fly_to_point_stop"   # 结束 flyto 飞向目标点任务
    FLY_TO_POINT_UPDATE = "fly_to_point_update"  # 更新 flyto 目标点
    RETURN_HOME = "return_home"  # 一键返航
    RETURN_HOME_CANCEL = "return_home_cancel"  # 取消返航

    # 获取 method 字段
    def get_method(self):
        return self.value

# 示例用法
if __name__ == "__main__":
    # 获取某个枚举的值
    print(ControlFlyMethodEnum.FLIGHT_AUTHORITY_NOTIFY.get_method())  # 输出: cloud_control_auth_notify

    # 遍历枚举项
    for method in ControlFlyMethodEnum:
        print(method.name, method.value)
